﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Messages.ascx.cs" Inherits="controls_admin_Messages" %>
<%@ Register Namespace="LibraryO2S" Assembly="O2S" TagPrefix="cc" %>
<!-- table -->
<div class="box">
    <!-- box / title -->
    <div class="title">
        <h5 runat="server" id="title">
            Messages
        </h5>
        <div class="search">
            <div class="input">
            </div>
            <div class="button">
            </div>
        </div>
    </div>
    <div id="divMessage" runat="server">
    </div>
    <!-- end box / title -->
    <div class="table">
        <asp:Repeater ID="rptMessages" runat="server">
            <HeaderTemplate>
                <table>
                    <thead>
                        <tr>
                            <th>
                                Tiêu đề
                            </th>
                            <th class="last">
                                Xem
                            </th>
                        </tr>
                    </thead>
                    <tbody>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td align="center">
                        <%#Eval("Title")%>
                    </td>
                    <td class="last" align="center">
                        <a href='<%#Eval("Redirect")%>'>
                            <%#Eval("Redirect")%></a>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </tbody> </table>
            </FooterTemplate>
        </asp:Repeater>
        <div style="text-align: center; margin: 10px">
            <%if (Session["url"] != null)
              {
                  if (Request.UrlReferrer != null)
                  {
                      if (!Request.UrlReferrer.ToString().Equals(Request.Url.ToString()))
                      {
                          Session["url"] = Request.UrlReferrer.ToString();                      
                  
            %>
            <a onclick="history.go(-1);" title="Trang trước">
                <%
}
                      else
                      {
                %>
                <a href='<%=Session["url"].ToString() %>' title="Trang trước">
                    <%   
}
                  }
                  else
                  {                      
                    %>
                    <a onclick="history.go(-1);" title="Trang trước">
                        <%}
              }
              else
              {
                  if (Request.UrlReferrer != null)
                      Session.Add("url", Request.UrlReferrer.ToString());
                  else
                      Session.Add("url", Request.Url.ToString());
                        %>
                        <a href="default.aspx" title="Trang trước">
                            <%} %>
                            <img src="../resources/images/icons/16x16/arrow-return.png" alt="Trang trước" /></a>
                        &nbsp;&nbsp; <a href="default.aspx" title="Trang chủ">
                            <img src="../resources/images/icons/16x16/home.png" alt="Trang chủ" /></a>
        </div>
    </div>
</div>
